package guiServer;

import interfaces.ServerInterface;

import java.rmi.Naming;
import java.rmi.server.UnicastRemoteObject;
import java.util.TreeSet;

import loja.Produto;
import loja.Servidor;
import loja.ServidorSrv;

public class Principal {

	public static TabManager tabManager;
	public static Janela janela;
	public static TreeSet<Produto> resultadosBusca;
	public static ServidorSrv servidor;
	public static Servidor serviceRmi;

	static {
		servidor = new ServidorSrv();
		serviceRmi = new Servidor();
		tabManager = new TabManager();
	}

	public static void main(String[] args) {
		try {
			UnicastRemoteObject.exportObject(serviceRmi);
			ServerInterface service = serviceRmi;
			Naming.rebind("Servidor", service);
		} catch (Exception ex) {
			ex.printStackTrace();
		}

		janela = new Janela();
	}
}
